package com.java.shop.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.java.common.validate.ListValue;
import com.java.common.validate.SaveGroup;
import com.java.common.validate.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * Ʒ
 * 
 * @author cxq
 * @email 137512476@qq.com
 * @date 2021-03-26 11:19:52
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@NotNull(message = "更新数据Id不能为空", groups = {UpdateGroup.class})
	@Null(message = "添加数据Id必须为空", groups = {SaveGroup.class})
	@JsonSerialize(using = ToStringSerializer.class)
	@TableId
	private Long brandId;
	/**
	 * 品牌名称
	 */
	@NotBlank(message = "品牌名称不能为空", groups = {SaveGroup.class})
	private String name;
	/**
	 * 品牌logo
	 */
	private String logo;
	/**
	 * 描述
	 */
	private String descript;
	/**
	 * 状态
	 */
	@ListValue(value = {0,1},groups = {SaveGroup.class, UpdateGroup.class})
	@TableLogic(delval = "0",value = "1")
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	private String firstLetter;
	/**
	 * 排序
	 */
	private Integer sort;

}
